package springboot.j2024_11_3;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JSONUtils {
    private static ObjectMapper objectMapper = new ObjectMapper();

    public static void main(String[] args) throws JsonProcessingException {
//
//        UserInfo userInfo = new UserInfo();
//       userInfo.setAge(11);
//       userInfo.setId(1);
//       userInfo.setName("张三");
//       userInfo.setLen(1);
//       String json =  objectMapper.writeValueAsString(userInfo);
//        System.out.println(json);
//        UserInfo userInfo1 = objectMapper.readValue(json , UserInfo.class);
//        System.out.println(userInfo1);
    }
}
